home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_08_11
/
8n11090a
< prev
next >
Wrap
Text File
|
1990-09-16
|
697b
|
33 lines
class Frog {
public:
Frog( char *Name)
{
name = Name;
count++;
}
~Frog() { count--; }
// instance interface
void jump() { distance += 100; }
void hop() { distance += 50; }
void skip() { distance += 25; }
void swim() { distance += 25; }
void print()
{
printf( "Frog name is %s,
distance from pond is %d\n" );
}
static int howmany() { return count; }
private:
// instance variables
int distance;
char *name;
// type-as-object variables
static int count;
};